<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="if (top.frames['componentsframe'] == undefined) { s = window.location.toString(); window.location = 'index.html?p=' + s.substring(s.lastIndexOf('/')+1); }">
<h2 class="comptitle">Simple Module <i>MassMobility</i></h2>
<b>Package:</b> inet.mobility.models<br/><b>File: <a href="src-inet_stub-mobility-models-MassMobility.ned.html">src/inet_stub/mobility/models/MassMobility.ned</a></b><br/><p><a href="../doxy/a00139.html" target="mainframe"><b>C++ definition</b></a></p>

<p>This is a random mobility model for a mobile host with a mass. It is the
one used in "Optimized Smooth Handoffs in Mobile IP" by Perkins &amp;Wang.</p>
<p>"An MH moves within the room according to the following pattern. It moves
along a straight line for a certain period of time before it makes a turn.
This moving period is a random number, normally distributed with average of
5 seconds and standard deviation of 0.1 second. When it makes a turn, the
new direction (angle) in which it will move is a normally distributed
random number with average equal to the previous direction and standard
deviation of 30 degrees. Its speed is also a normally distributed random
number, with a controlled average, ranging from 0.1 to 0.45 (unit/sec), and
standard deviation of 0.01 (unit/sec). A new such random number is picked
as its speed when it makes a turn. This pattern of mobility is intended to
model node movement during which the nodes have momentum, and thus do not
start, stop, or turn abruptly. When it hits a wall, it reflects off the
wall at the same angle; in our simulated world, there is little other
choice."</p>
<p>This implementation can be parameterized a bit more, via the changeInterval,
changeAngleBy and changeSpeedBy parameters. The parameters described above
correspond to the following settings:</p>
  <ul><ul><li>changeInterval = normal(5, 0.1)</li>
  <li>changeAngleBy = normal(0, 30)</li>
  <li>speed = normal(avgSpeed, 0.01)</li></ul></ul>
<p><b>Author:</b> Emin Ilker Cetinbas, Andras Varga</p>
<img src="inet.mobility.models.MassMobility-type.png" ismap="yes" usemap="#type-diagram"/><map name="type-diagram">
<area shape="rect" href="inet.mobility.models.MassMobility.html" title="MassMobility" alt="MassMobility" coords="0,30,117,70">
</map>
<h3 class="subtitle">Usage diagram:</h3>
<p>The following diagram shows usage relationships between types.
Unresolved types are missing from the diagram. Click <a href="full-ned-usage-diagram.html">here</a> to see the full picture.</p>
<img src="inet.mobility.models.MassMobility-usage.png" ismap="yes" usemap="#usage-diagram"/><map name="usage-diagram"><area shape="rect" href="inet.mobility.models.MassMobility.html" title="Simple Module MassMobility" alt="MassMobility" coords="7,16,95,40">
</map>
<h3 class="subtitle">Inheritance diagram:</h3>
<p>The following diagram shows inheritance relationships for this type.
Unresolved types are missing from the diagram. Click <a href="full-ned-inheritance-diagram.html">here</a> to see the full picture.</p>
<img src="inet.mobility.models.MassMobility-inheritance.png" ismap="yes" usemap="#inheritance-diagram"/><map name="inheritance-diagram"><area shape="rect" href="inet.mobility.models.MassMobility.html" title="Simple Module MassMobility" alt="MassMobility" coords="25,88,113,112">
<area shape="rect" href="inet.mobility.models.MovingMobilityBase.html" title="Simple Module MovingMobilityBase" alt="MovingMobilityBase" coords="7,16,132,40">
</map>
<h3 class="subtitle">Extends:</h3>
<table class="typestable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Type</th>
      <th class="description">Description</th>
   </tr>
<tr>
   <td>
<a href="inet.mobility.models.MovingMobilityBase.html">MovingMobilityBase</a>
   </td>
   <td>
<i>simple&nbsp;module</i>
   </td>
   <td>

<p>Abstract base module for mobility models.</p>

   </td>
</tr>
</table>
<h3 class="subtitle">Parameters:</h3>
<table class="paramstable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Type</th>
      <th class="defaultvalue">Default value</th>
      <th class="description">Description</th>
   </tr>
<tr class="inherited">
   <td>debug</td>
   <td>
      <i>bool</i>
   </td>
   <td>false</td>
   <td>   </td>
</tr>
<tr class="inherited">
   <td>constraintAreaMinX</td>
   <td>
      <i>double</i>
   </td>
   <td>-1m/0</td>
   <td>
<p>min x position of the constraint area, unconstrained by default (negative infinity)</p>
   </td>
</tr>
<tr class="inherited">
   <td>constraintAreaMinY</td>
   <td>
      <i>double</i>
   </td>
   <td>-1m/0</td>
   <td>
<p>min y position of the constraint area, unconstrained by default (negative infinity)</p>
   </td>
</tr>
<tr class="inherited">
   <td>constraintAreaMinZ</td>
   <td>
      <i>double</i>
   </td>
   <td>-1m/0</td>
   <td>
<p>min z position of the constraint area, unconstrained by default (negative infinity)</p>
   </td>
</tr>
<tr class="inherited">
   <td>constraintAreaMaxX</td>
   <td>
      <i>double</i>
   </td>
   <td>1m/0</td>
   <td>
<p>max x position of the constraint area, unconstrained by default (positive infinity)</p>
   </td>
</tr>
<tr class="inherited">
   <td>constraintAreaMaxY</td>
   <td>
      <i>double</i>
   </td>
   <td>1m/0</td>
   <td>
<p>max y position of the constraint area, unconstrained by default (positive infinity)</p>
   </td>
</tr>
<tr class="inherited">
   <td>constraintAreaMaxZ</td>
   <td>
      <i>double</i>
   </td>
   <td>1m/0</td>
   <td>
<p>max z position of the constraint area, unconstrained by default (positive infinity)</p>
   </td>
</tr>
<tr class="inherited">
   <td>updateInterval</td>
   <td>
      <i>double</i>
   </td>
   <td>0.1s</td>
   <td>
<p>the simulation time interval used to regularly signal mobility state changes and update the display</p>
   </td>
</tr>
<tr class="local">
   <td>initialX</td>
   <td>
      <i>double</i>
   </td>
   <td>uniform(constraintAreaMinX, constraintAreaMaxX)</td>
   <td>   </td>
</tr>
<tr class="local">
   <td>initialY</td>
   <td>
      <i>double</i>
   </td>
   <td>uniform(constraintAreaMinY, constraintAreaMaxY)</td>
   <td>   </td>
</tr>
<tr class="local">
   <td>initialZ</td>
   <td>
      <i>double</i>
   </td>
   <td>uniform(constraintAreaMinZ, constraintAreaMaxZ)</td>
   <td>   </td>
</tr>
<tr class="local">
   <td>startAngle</td>
   <td>
      <i>double</i>
   </td>
   <td>uniform(0deg, 360deg)</td>
   <td>
<p>initial angle in degrees</p>
   </td>
</tr>
<tr class="local">
   <td>initFromDisplayString</td>
   <td>
      <i>bool</i>
   </td>
   <td>true</td>
   <td>   </td>
</tr>
<tr class="local">
   <td>changeInterval</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>frequency of changing speed and angle (can be random)</p>
   </td>
</tr>
<tr class="local">
   <td>changeAngleBy</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>change angle by this much (can be random)</p>
   </td>
</tr>
<tr class="local">
   <td>speed</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>speed (can be random, updated every changeInterval)</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Properties:</h3>
<table class="propertiestable">
   <tr>
      <th class="name">Name</th>
      <th class="value">Value</th>
      <th class="description">Description</th>
   </tr>
<tr>
   <td>display</td>
   <td><i>i=block/cogwheel</i></td>
   <td></td>
</tr>
<tr>
   <td>class</td>
   <td><i>MassMobility</i></td>
   <td></td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #808080; font-style: italic; ">//
// This is a random mobility model for a mobile host with a mass. It is the
// one used in &quot;Optimized Smooth Handoffs in Mobile IP&quot; by Perkins &amp;Wang.
//
// &quot;An MH moves within the room according to the following pattern. It moves
// along a straight line for a certain period of time before it makes a turn.
// This moving period is a random number, normally distributed with average of
// 5 seconds and standard deviation of 0.1 second. When it makes a turn, the
// new direction (angle) in which it will move is a normally distributed
// random number with average equal to the previous direction and standard
// deviation of 30 degrees. Its speed is also a normally distributed random
// number, with a controlled average, ranging from 0.1 to 0.45 (unit/sec), and
// standard deviation of 0.01 (unit/sec). A new such random number is picked
// as its speed when it makes a turn. This pattern of mobility is intended to
// model node movement during which the nodes have momentum, and thus do not
// start, stop, or turn abruptly. When it hits a wall, it reflects off the
// wall at the same angle; in our simulated world, there is little other
// choice.&quot;
//
// This implementation can be parameterized a bit more, via the changeInterval,
// changeAngleBy and changeSpeedBy parameters. The parameters described above
// correspond to the following settings:
//    - changeInterval = normal(5, 0.1)
//    - changeAngleBy = normal(0, 30)
//    - speed = normal(avgSpeed, 0.01)
//
// </span><span style="color: #000080; ">@author</span><span style="color: #808080; font-style: italic; "> Emin Ilker Cetinbas, Andras Varga
//
</span><span style="color: #800000; font-weight: bold; ">simple</span><span style="color: #000000; "> </span><span style="color: #000000; ">MassMobility</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">extends</span><span style="color: #000000; "> </span><span style="color: #000000; ">MovingMobilityBase</span><span style="color: #000000; ">
{
    </span><span style="color: #800000; font-weight: bold; ">parameters</span><span style="color: #000000; ">:
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">initialX</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">m</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #800080; font-weight: bold; ">uniform</span><span style="color: #000000; ">(</span><span style="color: #000000; ">constraintAreaMinX</span><span style="color: #000000; ">, </span><span style="color: #000000; ">constraintAreaMaxX</span><span style="color: #000000; ">));
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">initialY</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">m</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #800080; font-weight: bold; ">uniform</span><span style="color: #000000; ">(</span><span style="color: #000000; ">constraintAreaMinY</span><span style="color: #000000; ">, </span><span style="color: #000000; ">constraintAreaMaxY</span><span style="color: #000000; ">));
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">initialZ</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">m</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #800080; font-weight: bold; ">uniform</span><span style="color: #000000; ">(</span><span style="color: #000000; ">constraintAreaMinZ</span><span style="color: #000000; ">, </span><span style="color: #000000; ">constraintAreaMaxZ</span><span style="color: #000000; ">));
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">startAngle</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">deg</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #800080; font-weight: bold; ">uniform</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">deg</span><span style="color: #000000; ">, </span><span style="color: #008000; ">360</span><span style="color: #000000; ">deg</span><span style="color: #000000; ">)); </span><span style="color: #808080; font-style: italic; ">// initial angle in degrees
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">initFromDisplayString</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">true</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">changeInterval</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// frequency of changing speed and angle (can be random)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">changeAngleBy</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">deg</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// change angle by this much (can be random)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">speed</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">mps</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// speed (can be random, updated every changeInterval)
</span><span style="color: #000000; ">        </span><span style="color: #000000; font-weight: bold; ">@class</span><span style="color: #000000; ">(</span><span style="color: #000000; ">MassMobility</span><span style="color: #000000; ">);
}
</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
